// components/register-global-components.ts
// import { App } from 'vue'

// 导入自定义组件
import IIcon from './IIcon/index.vue'
import NavBar from './NavBar/index.vue'
import SvgIcon from './SvgIcon/index.vue'
import Tabbar from './Tabbar/index.vue'

// 导入 Vant 组件
import {
    Button,
    CellGroup,
    ConfigProvider,
    DatePicker,
    Field,
    Form,
    Icon,
    NavBar as VanNavBar,
    Picker,
    Popup,
    Progress,
    Radio,
    RadioGroup,
    ShareSheet,
    Tab,
    Tabbar as VanTabbar,
    TabbarItem,
    Tabs
} from 'vant'

export function registerGlobalComponents(app) {
    // 注册自定义组件
    app.component('IIcon', IIcon)
    app.component('NavBar', NavBar)
    app.component('SvgIcon', SvgIcon)
    app.component('Tabbar', Tabbar)

    // 注册 Vant 组件（使用带 Van 前缀的命名）
    app.component('VanButton', Button)
    app.component('VanCellGroup', CellGroup)
    app.component('VanConfigProvider', ConfigProvider)
    app.component('VanDatePicker', DatePicker)
    app.component('VanField', Field)
    app.component('VanForm', Form)
    app.component('VanIcon', Icon)
    app.component('VanNavBar', VanNavBar)
    app.component('VanPicker', Picker)
    app.component('VanPopup', Popup)
    app.component('VanProgress', Progress)
    app.component('VanRadio', Radio)
    app.component('VanRadioGroup', RadioGroup)
    app.component('VanShareSheet', ShareSheet)
    app.component('VanTab', Tab)
    app.component('VanTabbar', VanTabbar)
    app.component('VanTabbarItem', TabbarItem)
    app.component('VanTabs', Tabs)
}